package com.jiaai.cloud.wx.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jiaai.cloud.base.page.CustomPage;
import com.jiaai.cloud.base.page.FrontPage;
import com.jiaai.cloud.wx.entity.TWxgoods;
import com.jiaai.cloud.wx.mapper.TWxgoodsMapper;
import com.jiaai.cloud.wx.service.ITWxgoodsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 佳爱网络科技
 * @since 2017-08-22
 */
@Service
public class TWxgoodsServiceImpl extends ServiceImpl<TWxgoodsMapper, TWxgoods> implements ITWxgoodsService {

    @Autowired
    private TWxgoodsMapper tWxgoodsMapper;

    @Override
    public void insertBackGoodsid(TWxgoods tWxgoods) {
        tWxgoodsMapper.insertBackGoodsid(tWxgoods);
    }

    @Override
    public void insertShopGoods(Integer shopid, Integer goodsid) {
        tWxgoodsMapper.insertShopGoods(shopid, goodsid);
    }

    @Override
    public void deleteShopGoods(Integer goodsid) {
        tWxgoodsMapper.deleteShopGoods(goodsid);
    }

    @Override
    public void updateGoodsclass(Integer goodsclassid) {
        tWxgoodsMapper.updateGoodsclass(goodsclassid);
    }

    @Override
    public CustomPage<TWxgoods> queryForMySuper(Integer userid, Page page) {
        page.setSearchCount(false);
        page.setRecords(tWxgoodsMapper.queryForMySuper(userid, page));
        return new CustomPage<TWxgoods>(page);
    }

}
